﻿<Window x:Class="TFlic.View.AuthorizationWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        
        xmlns:local="clr-namespace:TFlic.View"
        xmlns:vm="clr-namespace:TFlic.ViewModel"
        
        mc:Ignorable="d"
        Title="Авторизация" Height="450" Width="800"
        WindowStyle="None"
        ResizeMode="NoResize"
        WindowStartupLocation="CenterScreen"
        Background="Transparent"
        AllowsTransparency="True"
        MouseDown="Window_MouseDown">

    <Window.DataContext>
        <vm:AuthorizationWindowViewModel/>
    </Window.DataContext>

    <Border CornerRadius="15">
        <Border.Background>
            <ImageBrush ImageSource="/Resources/Images/kanban2.jpg"
                        Stretch="None"/>
        </Border.Background>

        <Border CornerRadius="15"
            BorderThickness="5"
            Opacity="0.9">

            <Border.BorderBrush>
                <SolidColorBrush Color="#565656" Opacity="1"/>
            </Border.BorderBrush>
            <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop Color="#5F5F5F" Offset="0"/>
                    <GradientStop Color="#6A6A6A" Offset="0.25"/>
                    <GradientStop Color="#8E8E8E" Offset="0.5"/>
                    <GradientStop Color="#6A6A6A" Offset="0.75"/>
                    <GradientStop Color="#5F5F5F" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="25"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <Grid Grid.Row="0">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="25"/>
                        <ColumnDefinition Width="25"/>
                        <ColumnDefinition Width="5"/>
                    </Grid.ColumnDefinitions>

                    <TextBlock Text="Авторизация"
                       FontSize="20"
                       Grid.Column="0"
                       VerticalAlignment="Center"
                       Margin="10,0,0,0"
                       />

                    <Button x:Name="BMinimize"
                            Grid.Column="1"
                            Click="BMinimize_Click" 
                            Style="{DynamicResource MinimizeWindowButtonStyle}"
                            Template="{DynamicResource MinimizeWindowButtonTemplate}"/>

                    <Button x:Name="BClose"  
                            Grid.Column="2" 
                            Click="BClose_Click"
                            Style="{DynamicResource CloseWindowButtonStyle}"
                            Template="{DynamicResource CloseWindowButtonTemplate}" Cursor="Arrow"/>

                </Grid>
                <Grid Grid.Row="1">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition x:Name="LogoColumn" />
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition x:Name="AuthorColumn" Width="4*" />
                    </Grid.ColumnDefinitions>

                    <Image x:Name="image" Grid.Column="0" Source="/Resources/Images/Logo.png" Grid.ColumnSpan="2"/>

                    <StackPanel Grid.Column="2"
                            Width="250"
                            Orientation="Vertical"
                            Margin="0,35,0,0">

                        <TextBlock Text="Логин" 
                                   FontSize="12" 
                                   FontWeight="Medium" 
                                   Margin="0,50,0,0"/>
                        <TextBox x:Name="Login" 
                                 FontSize="13" 
                                 Height="28" 
                                 Margin="0,5,0,0" 
                                 Style="{DynamicResource TextBoxesStyle}"
                                 Text="{Binding Login, UpdateSourceTrigger=PropertyChanged}"/>

                        <TextBlock Text="Пароль" 
                                   FontSize="12" 
                                   FontWeight="Medium" 
                                   Margin="0,50,0,0"/>
                        <PasswordBox x:Name="Password" 
                                     FontSize="13" 
                                     Height="28" 
                                     Margin="0,5,0,0" 
                                     Style="{DynamicResource PasswordBoxesStyle}"/>
                        <TextBlock Text="{Binding InfoMessage, UpdateSourceTrigger=PropertyChanged}"
                                   FontSize="12" 
                                   FontWeight="Medium" 
                                   Foreground="#A60000"
                                   TextWrapping="Wrap"/>

                        <Button x:Name="Enter" 
                                Content="Войти" 
                                Grid.Column="1" 
                                Margin="0,10,0,0"
                                Width="200"
                                Height="25"
                                Style="{DynamicResource ButtonStyle}"
                                Template="{DynamicResource ButtonTemplate}" Cursor="Arrow"
                                Click="Enter_Click"
                                Command="{Binding LoginCommand}"/>
                        <Button x:Name="Registration" 
                                Content="Зарегистрироваться" 
                                Command="{Binding OpenRegistrationWindowCommand}" 
                                Grid.Column="1" 
                                Margin="0,10,0,0" 
                                Width="200"
                                Height="25"
                                Style="{DynamicResource ButtonStyle}" 
                                Template="{DynamicResource ButtonTemplate}">
                        </Button>
                    </StackPanel>
                </Grid>
            </Grid>
        </Border>
    </Border>
</Window>